]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Tweak temperature labels
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 18 Dec 2019 23:45:17 +0000 (00:45 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 9 Jan 2020 16:13:19 +0000 (17:13 +0100)
Together with the forecast icon, the temperature label is the most
important information in the weather section. To emphasize it more,
reduce its space requirement by removing the temperature unit, then
make the text bold.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1143

data/theme/gnome-shell-sass/widgets/_calendar.scss
js/ui/dateMenu.js

index 0c7c5fd24f6e05446ebcec2dfbf10c49c2e5bb6e..fcd4448add785c4c1a92965c15abba46519564ac 100644 (file)
     icon-size: $base_icon_size * 2;
   }
 
+  .weather-forecast-temp {
+    font-weight: bold;
+  }
+
   .weather-forecast-time {
     color: darken($fg_color,30%);
     font-feature-settings: "tnum";
index af0984697a7735b6ea8213c6bb3eb464c092f5b8..e7d3c47b26d453b5abfc779745660834c2d4c8a0 100644 (file)
@@ -348,6 +348,8 @@ class WeatherSection extends St.Button {
                 timeOnly: true,
                 ampm: false,
             });
+            const [, tempValue] = fc.get_value_temp(GWeather.TemperatureUnit.DEFAULT);
+            const tempPrefix = tempValue >= 0 ? ' ' : '';
 
             let icon = new St.Icon({
                 style_class: 'weather-forecast-icon',
@@ -357,7 +359,7 @@ class WeatherSection extends St.Button {
             });
             let temp = new St.Label({
                 style_class: 'weather-forecast-temp',
-                text: fc.get_temp_summary(),
+                text: '%s%.0f°'.format(tempPrefix, tempValue),
                 x_align: Clutter.ActorAlign.CENTER,
             });
             let time = new St.Label({